package com.ruoyi.postulant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.postulant.mapper.FeedbackMapper;
import com.ruoyi.postulant.domain.Feedback;
import com.ruoyi.postulant.service.IFeedbackService;

/**
 * 评价反馈Service业务层处理
 *
 * @author wanghong
 * @date 2025-03-15
 */
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService
{
    @Autowired
    private FeedbackMapper feedbackMapper;

    /**
     * 查询评价反馈
     *
     * @param id 评价反馈主键
     * @return 评价反馈
     */
    @Override
    public Feedback selectFeedbackById(Integer id)
    {
        return feedbackMapper.selectFeedbackById(id);
    }

    /**
     * 查询评价反馈列表
     *
     * @param feedback 评价反馈
     * @return 评价反馈
     */
    @Override
    public List<Feedback> selectFeedbackList(Feedback feedback)
    {
        return feedbackMapper.selectFeedbackList(feedback);
    }

    /**
     * 新增评价反馈
     *
     * @param feedback 评价反馈
     * @return 结果
     */
    @Override
    public int insertFeedback(Feedback feedback)
    {
        feedback.setCreateTime(DateUtils.getNowDate());
        return feedbackMapper.insertFeedback(feedback);
    }

    /**
     * 修改评价反馈
     *
     * @param feedback 评价反馈
     * @return 结果
     */
    @Override
    public int updateFeedback(Feedback feedback)
    {
        feedback.setUpdateTime(DateUtils.getNowDate());
        return feedbackMapper.updateFeedback(feedback);
    }

    /**
     * 批量删除评价反馈
     *
     * @param ids 需要删除的评价反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedbackByIds(Integer[] ids)
    {
        return feedbackMapper.deleteFeedbackByIds(ids);
    }

    /**
     * 删除评价反馈信息
     *
     * @param id 评价反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedbackById(Integer id)
    {
        return feedbackMapper.deleteFeedbackById(id);
    }
}
